package com.egrand.sweetapi.web.service.impl;

import com.egrand.sweetapi.core.TenantService;
import com.egrand.sweetapi.web.context.TenantContextHolder;
import org.springframework.stereotype.Component;

/**
 * 多租户实现
 */
@Component
public class TenantServiceImpl implements TenantService {

    @Override
    public String getTenant() {
        return TenantContextHolder.getTenant();
    }

    @Override
    public void setTenant(String tenant) {
        TenantContextHolder.setTenant(tenant);
    }

    @Override
    public void clear() {
        TenantContextHolder.clear();
    }
}
